package org.akomantoso.core.visitor;

import org.akomantoso.core.data.*;

public class StackableDefaultVisitor implements AKVisitor {

	private final static int DEFAULT_MAX_LENGTH = 40;
	
	protected final String[] _path = new String[DEFAULT_MAX_LENGTH];
	protected final Object[] _pathObject = new Object[DEFAULT_MAX_LENGTH];
	
	protected int _index = 0;
	
	protected final void push(String name,Object object) {
		int i = _index;
		_path[i] = name;
		_pathObject[i] = object;
		_index++;
	}
	
	protected final void pop() {
		_index--;
	}
	
	@Override
	public boolean visitBegin(AmendmentList amendmentList) {
		push(AmendmentList.ELEMENT,amendmentList);
		return true;
	}

	@Override
	public boolean visitBegin(OfficialGazette officialGazette) {
		push(OfficialGazette.ELEMENT,officialGazette);
		return true;
	}

	@Override
	public boolean visitBegin(Doc doc) {
		push(Doc.ELEMENT,doc);
		return true;
	}

	@Override
	public boolean visitBegin(Debate debate) {
		push(Debate.ELEMENT,debate);
		return true;
	}

	@Override
	public boolean visitBegin(DebateReport debateReport) {
		push(DebateReport.ELEMENT,debateReport);
		return true;
	}

	@Override
	public boolean visitBegin(DocumentCollection documentCollection) {
		push(DocumentCollection.ELEMENT,documentCollection);
		return true;
	}

	@Override
	public boolean visitBegin(Bill bill) {
		push(Bill.ELEMENT,bill);
		return true;
	}

	@Override
	public boolean visitBegin(Act act) {
		push(Act.ELEMENT,act);
		return true;
	}

	@Override
	public boolean visitBegin(Judgement judgement) {
		push(Judgement.ELEMENT,judgement);
		return true;
	}

	@Override
	public boolean visitBegin(Amendment amendment) {
		push(Amendment.ELEMENT,amendment);
		return true;
	}

	@Override
	public boolean visitBegin(Document document) {
		push(Document.ELEMENT,document);
		return true;
	}

	@Override
	public void visitEnd(AmendmentList amendmentList) {
		pop();
	}

	@Override
	public void visitEnd(OfficialGazette officialGazette) {
		pop();
	}

	@Override
	public void visitEnd(Doc doc) {
		pop();
	}

	@Override
	public void visitEnd(Debate debate) {
		pop();
	}

	@Override
	public void visitEnd(DebateReport debateReport) {
		pop();
	}

	@Override
	public void visitEnd(DocumentCollection documentCollection) {
		pop();
	}

	@Override
	public void visitEnd(Bill bill) {
		pop();
	}

	@Override
	public void visitEnd(Act act) {
		pop();
	}

	@Override
	public void visitEnd(Judgement judgement) {
		pop();
	}

	@Override
	public void visitEnd(Amendment amendment) {
		pop();
	}

	@Override
	public void visitEnd(Document document) {
		pop();
	}

	@Override
	public boolean visitBegin(I i) {
		push(I.ELEMENT,i);
		return true;
	}

	@Override
	public boolean visitBegin(A a) {
		push(A.ELEMENT,a);
		return true;
	}

	@Override
	public boolean visitBegin(B b) {
		push(B.ELEMENT,b);
		return true;
	}

	@Override
	public boolean visitBegin(U u) {
		push(U.ELEMENT,u);
		return true;
	}

	@Override
	public boolean visitBegin(Sub sub) {
		push(Sub.ELEMENT,sub);
		return true;
	}

	@Override
	public boolean visitBegin(Sup sup) {
		push(Sup.ELEMENT,sup);
		return true;
	}

	@Override
	public boolean visitBegin(Span span) {
		push(Span.ELEMENT,span);
		return true;
	}

	@Override
	public void visitEnd(I i) {
		pop();
	}

	@Override
	public void visitEnd(A a) {
		pop();
	}

	@Override
	public void visitEnd(B b) {
		pop();
	}

	@Override
	public void visitEnd(U u) {
		pop();
	}

	@Override
	public void visitEnd(Sub sub) {
		pop();
	}

	@Override
	public void visitEnd(Sup sup) {
		pop();
	}

	@Override
	public void visitEnd(Span span) {
		pop();
	}

	@Override
	public boolean visitBegin(P p) {
		push(P.ELEMENT,p);
		return true;
	}

	@Override
	public boolean visitBegin(Ol ol) {
		push(Ol.ELEMENT,ol);
		return true;
	}

	@Override
	public void visitEnd(P p) {
		pop();
	}

	@Override
	public void visitEnd(Ol ol) {
		pop();
	}

	@Override
	public boolean visitBegin(Chapter chapter) {
		push(Chapter.ELEMENT,chapter);
		return true;
	}

	@Override
	public boolean visitBegin(SubChapter subChapter) {
		push(SubChapter.ELEMENT,subChapter);
		return true;
	}

	@Override
	public boolean visitBegin(Section section) {
		push(Section.ELEMENT,section);
		return true;
	}

	@Override
	public boolean visitBegin(SubSection subSection) {
		push(SubSection.ELEMENT,subSection);
		return true;
	}

	@Override
	public boolean visitBegin(Paragraph paragraph) {
		push(Paragraph.ELEMENT,paragraph);
		return true;
	}

	@Override
	public boolean visitBegin(SubParagraph subParagraph) {
		push(SubParagraph.ELEMENT,subParagraph);
		return true;
	}

	@Override
	public boolean visitBegin(Part part) {
		push(Part.ELEMENT,part);
		return true;
	}

	@Override
	public boolean visitBegin(Point point) {
		push(Point.ELEMENT,point);
		return true;
	}

	@Override
	public boolean visitBegin(Clause clause) {
		push(Clause.ELEMENT,clause);
		return true;
	}

	@Override
	public boolean visitBegin(Article article) {
		push(Article.ELEMENT,article);
		return true;
	}

	@Override
	public void visitEnd(Chapter chapter) {
		pop();
	}

	@Override
	public void visitEnd(SubChapter subChapter) {
		pop();
	}

	@Override
	public void visitEnd(Section section) {
		pop();
	}

	@Override
	public void visitEnd(SubSection subSection) {
		pop();
	}

	@Override
	public void visitEnd(Paragraph paragraph) {
		pop();
	}

	@Override
	public void visitEnd(SubParagraph subParagraph) {
		pop();
	}

	@Override
	public void visitEnd(Part part) {
		pop();
	}

	@Override
	public void visitEnd(Point point) {
		pop();
	}

	@Override
	public void visitEnd(Clause clause) {
		pop();
	}

	@Override
	public void visitEnd(Article article) {
		pop();
	}

	@Override
	public boolean visitBegin(Hcontainer hcontainer) {
		push(Hcontainer.ELEMENT,hcontainer);
		return true;
	}

	@Override
	public void visitEnd(Hcontainer hcontainer) {
		pop();
	}

	@Override
	public boolean visitBegin(Session session) {
		push(Session.ELEMENT,session);
		return true;
	}

	@Override
	public boolean visitBegin(Legislature legislature) {
		push(Legislature.ELEMENT,legislature);
		return true;
	}

	@Override
	public boolean visitBegin(DocCommittee docCommittee) {
		push(DocCommittee.ELEMENT,docCommittee);
		return true;
	}

	@Override
	public boolean visitBegin(DocProponent docProponent) {
		push(DocProponent.ELEMENT,docProponent);
		return true;
	}

	@Override
	public boolean visitBegin(DocIntroducer docIntroducer) {
		push(DocIntroducer.ELEMENT,docIntroducer);
		return true;
	}

	@Override
	public boolean visitBegin(DocNumber docNumber) {
		push(DocNumber.ELEMENT,docNumber);
		return true;
	}

	@Override
	public boolean visitBegin(DocTitle docTitle) {
		push(DocTitle.ELEMENT,docTitle);
		return true;
	}

	@Override
	public boolean visitBegin(DocketNumber docketNumber) {
		push(DocketNumber.ELEMENT,docketNumber);
		return true;
	}

	@Override
	public boolean visitBegin(DocType docType) {
		push(DocType.ELEMENT,docType);
		return true;
	}

	@Override
	public boolean visitBegin(DocDate docDate) {
		push(DocDate.ELEMENT,docDate);
		return true;
	}

	@Override
	public void visitEnd(Session session) {
		pop();
	}

	@Override
	public void visitEnd(Legislature legislature) {
		pop();
	}

	@Override
	public void visitEnd(DocCommittee docCommittee) {
		pop();
	}

	@Override
	public void visitEnd(DocProponent docProponent) {
		pop();
	}

	@Override
	public void visitEnd(DocIntroducer docIntroducer) {
		pop();
	}

	@Override
	public void visitEnd(DocNumber docNumber) {
		pop();
	}

	@Override
	public void visitEnd(DocTitle docTitle) {
		pop();
	}

	@Override
	public void visitEnd(DocketNumber docketNumber) {
		pop();
	}

	@Override
	public void visitEnd(DocType docType) {
		pop();
	}

	@Override
	public void visitEnd(DocDate docDate) {
		pop();
	}

	@Override
	public boolean visitBegin(Adjournment adjournment) {
		push(Adjournment.ELEMENT,adjournment);
		return true;
	}

	@Override
	public boolean visitBegin(AdministrationOfOath administrationOfOath) {
		push(AdministrationOfOath.ELEMENT,administrationOfOath);
		return true;
	}

	@Override
	public boolean visitBegin(Communication communication) {
		push(Communication.ELEMENT,communication);
		return true;
	}

	@Override
	public boolean visitBegin(DebateSection debateSection) {
		push(DebateSection.ELEMENT,debateSection);
		return true;
	}

	@Override
	public boolean visitBegin(OralStatements oralStatements) {
		push(OralStatements.ELEMENT,oralStatements);
		return true;
	}

	@Override
	public boolean visitBegin(Prayers prayers) {
		push(Prayers.ELEMENT,prayers);
		return true;
	}

	@Override
	public boolean visitBegin(RollCall rollCall) {
		push(RollCall.ELEMENT,rollCall);
		return true;
	}

	@Override
	public void visitEnd(Adjournment adjournment) {
		pop();
	}

	@Override
	public void visitEnd(AdministrationOfOath administrationOfOath) {
		pop();
	}

	@Override
	public void visitEnd(Communication communication) {
		pop();
	}

	@Override
	public void visitEnd(DebateSection debateSection) {
		pop();
	}

	@Override
	public void visitEnd(OralStatements oralStatements) {
		pop();
	}

	@Override
	public void visitEnd(Prayers prayers) {
		pop();
	}

	@Override
	public void visitEnd(RollCall rollCall) {
		pop();
	}

	@Override
	public boolean visitBegin(Del del) {
		push(Del.ELEMENT,del);
		return true;
	}

	@Override
	public boolean visitBegin(Ins ins) {
		push(Ins.ELEMENT,ins);
		return true;
	}

	@Override
	public boolean visitBegin(Mmod mmod) {
		push(Mmod.ELEMENT,mmod);
		return true;
	}

	@Override
	public boolean visitBegin(Mref mref) {
		push(Mref.ELEMENT,mref);
		return true;
	}

	@Override
	public boolean visitBegin(Mod mod) {
		push(Mod.ELEMENT,mod);
		return true;
	}

	@Override
	public boolean visitBegin(Omissis omissis) {
		push(Omissis.ELEMENT,omissis);
		return true;
	}

	@Override
	public boolean visitBegin(Remark remark) {
		push(Remark.ELEMENT,remark);
		return true;
	}

	@Override
	public boolean visitBegin(Ref ref) {
		push(Ref.ELEMENT,ref);
		return true;
	}

	@Override
	public void visitEnd(Del del) {
		pop();
	}

	@Override
	public void visitEnd(Mmod mmod) {
		pop();
	}

	@Override
	public void visitEnd(Ins ins) {
		pop();
	}

	@Override
	public void visitEnd(Mref mref) {
		pop();
	}

	@Override
	public void visitEnd(Mod mod) {
		pop();
	}

	@Override
	public void visitEnd(Omissis omissis) {
		pop();
	}

	@Override
	public void visitEnd(Remark remark) {
		pop();
	}

	@Override
	public void visitEnd(Ref ref) {
		pop();
	}

	@Override
	public boolean visitBegin(Location location) {
		push(Location.ELEMENT,location);
		return true;
	}

	@Override
	public boolean visitBegin(Person person) {
		push(Person.ELEMENT,person);
		return true;
	}

	@Override
	public boolean visitBegin(Term term) {
		push(Term.ELEMENT,term);
		return true;
	}

	@Override
	public boolean visitBegin(Organization organization) {
		push(Organization.ELEMENT,organization);
		return true;
	}

	@Override
	public boolean visitBegin(Judge judge) {
		push(Judge.ELEMENT,judge);
		return true;
	}

	@Override
	public boolean visitBegin(Entity entity) {
		push(Entity.ELEMENT,entity);
		return true;
	}

	@Override
	public boolean visitBegin(Def def) {
		push(Def.ELEMENT,def);
		return true;
	}

	@Override
	public boolean visitBegin(Date date) {
		push(Date.ELEMENT,date);
		return true;
	}

	@Override
	public void visitEnd(Location location) {
		pop();
	}

	@Override
	public void visitEnd(Person person) {
		pop();
	}

	@Override
	public void visitEnd(Term term) {
		pop();
	}

	@Override
	public void visitEnd(Organization organization) {
		pop();
	}

	@Override
	public void visitEnd(Judge judge) {
		pop();
	}

	@Override
	public void visitEnd(Entity entity) {
		pop();
	}

	@Override
	public void visitEnd(Def def) {
		pop();
	}

	@Override
	public void visitEnd(Date date) {
		pop();
	}

	@Override
	public boolean visitBegin(Scene scene) {
		push(Scene.ELEMENT,scene);
		return true;
	}

	@Override
	public boolean visitBegin(Narrative narrative) {
		push(Narrative.ELEMENT,narrative);
		return true;
	}

	@Override
	public boolean visitBegin(Summary summary) {
		push(Summary.ELEMENT,summary);
		return true;
	}

	@Override
	public void visitEnd(Scene scene) {
		pop();
	}

	@Override
	public void visitEnd(Narrative narrative) {
		pop();
	}

	@Override
	public void visitEnd(Summary summary) {
		pop();
	}

	@Override
	public boolean visitBegin(AffectedDocument affectedDocument) {
		push(AffectedDocument.ELEMENT,affectedDocument);
		return true;
	}

	@Override
	public boolean visitBegin(Change change) {
		push(Change.ELEMENT,change);
		return true;
	}

	@Override
	public void visitEnd(AffectedDocument affectedDocument) {
		pop();
	}

	@Override
	public void visitEnd(Change change) {
		pop();
	}

	@Override
	public boolean visitBegin(LongTitle longTitle) {
		push(LongTitle.ELEMENT,longTitle);
		return true;
	}

	@Override
	public boolean visitBegin(Formula formula) {
		push(Formula.ELEMENT,formula);
		return true;
	}

	@Override
	public void visitEnd(LongTitle longTitle) {
		pop();
	}

	@Override
	public void visitEnd(Formula formula) {
		pop();
	}

	@Override
	public boolean visitBegin(Block block) {
		push(Block.ELEMENT,block);
		return true;
	}

	@Override
	public void visitEnd(Block block) {
		pop();
	}

	@Override
	public boolean visitBegin(Party party) {
		push(Party.ELEMENT,party);
		return true;
	}

	@Override
	public void visitEnd(Party party) {
		pop();
	}

	@Override
	public boolean visitBegin(Recital recital) {
		push(Recital.ELEMENT,recital);
		return true;
	}

	@Override
	public void visitEnd(Recital recital) {
		pop();
	}

	@Override
	public boolean visitBegin(Header header) {
		push(Header.ELEMENT,header);
		return true;
	}

	@Override
	public void visitEnd(Header header) {
		pop();
	}

	@Override
	public boolean visitBegin(AmendmentBody amendmentBody) {
		push(AmendmentBody.ELEMENT,amendmentBody);
		return true;
	}

	@Override
	public boolean visitBegin(AmendmentJustification amendmentJustification) {
		push(AmendmentJustification.ELEMENT,amendmentJustification);
		return true;
	}

	@Override
	public boolean visitBegin(AmendmentHeading amendmentHeading) {
		push(AmendmentHeading.ELEMENT,amendmentHeading);
		return true;
	}

	@Override
	public boolean visitBegin(AmendmentReference amendmentReference) {
		push(AmendmentReference.ELEMENT,amendmentReference);
		return true;
	}

	@Override
	public boolean visitBegin(AmendmentContent amendmentContent) {
		push(AmendmentContent.ELEMENT,amendmentContent);
		return true;
	}

	@Override
	public void visitEnd(AmendmentBody amendmentBody) {
		pop();
	}

	@Override
	public void visitEnd(AmendmentJustification amendmentJustification) {
		pop();
	}

	@Override
	public void visitEnd(AmendmentHeading amendmentHeading) {
		pop();
	}

	@Override
	public void visitEnd(AmendmentReference amendmentReference) {
		pop();
	}

	@Override
	public void visitEnd(AmendmentContent amendmentContent) {
		pop();
	}

	@Override
	public boolean visitBegin(JudgementBody judgementBody) {
		push(JudgementBody.ELEMENT,judgementBody);
		return true;
	}

	@Override
	public boolean visitBegin(Decision decision) {
		push(Decision.ELEMENT,decision);
		return true;
	}

	@Override
	public boolean visitBegin(Introduction introduction) {
		push(Introduction.ELEMENT,introduction);
		return true;
	}

	@Override
	public boolean visitBegin(Background background) {
		push(Background.ELEMENT,background);
		return true;
	}

	@Override
	public boolean visitBegin(Motivation motivation) {
		push(Motivation.ELEMENT,motivation);
		return true;
	}

	@Override
	public void visitEnd(Decision decision) {
		pop();
	}

	@Override
	public void visitEnd(JudgementBody judgementBody) {
		pop();
	}

	@Override
	public void visitEnd(Introduction introduction) {
		pop();
	}

	@Override
	public void visitEnd(Background background) {
		pop();
	}

	@Override
	public void visitEnd(Motivation motivation) {
		pop();
	}

	@Override
	public boolean visitBegin(Interstitial interstitial) {
		push(Interstitial.ELEMENT,interstitial);
		return true;
	}

	@Override
	public void visitEnd(Interstitial interstitial) {
		pop();
	}

	@Override
	public boolean visitBegin(Meta meta) {
		push(Meta.ELEMENT,meta);
		return true;
	}

	@Override
	public boolean visitBegin(CoverPage coverPage) {
		push(CoverPage.ELEMENT,coverPage);
		return true;
	}

	@Override
	public boolean visitBegin(Preface preface) {
		push(Preface.ELEMENT,preface);
		return true;
	}

	@Override
	public boolean visitBegin(Conclusions conclusions) {
		push(Conclusions.ELEMENT,conclusions);
		return true;
	}

	@Override
	public void visitEnd(Meta meta) {
		pop();
	}

	@Override
	public void visitEnd(Preface preface) {
		pop();
	}

	@Override
	public void visitEnd(CoverPage coverPage) {
		pop();
	}

	@Override
	public void visitEnd(Conclusions conclusions) {
		pop();
	}

	@Override
	public boolean visitBegin(Item item) {
		push(Item.ELEMENT,item);
		return true;
	}

	@Override
	public void visitEnd(Item item) {
		pop();
	}

	@Override
	public void visit(Publication publication) {
	}

	@Override
	public void visit(Img img) {
	}

	@Override
	public void visit(StringItem stringItem) {
	}

	@Override
	public void visit(Eop eop) {
	}

	@Override
	public void visit(Eol eol) {
	}

	@Override
	public void visit(ComponentRef componentRef) {
	}

	@Override
	public boolean visitBegin(From from) {
		push(From.ELEMENT,from);
		return true;
	}

	@Override
	public void visitEnd(From from) {
		pop();
	}

	@Override
	public boolean visitBegin(Note note) {
		push(Note.ELEMENT,note);
		return true;
	}

	@Override
	public void visitEnd(Note note) {
		pop();
	}

	@Override
	public boolean visitBegin(Heading heading) {
		push(Heading.ELEMENT,heading);
		return true;
	}

	@Override
	public void visitEnd(Heading heading) {
		pop();
	}

	@Override
	public boolean visitBegin(Caption caption) {
		push(Caption.ELEMENT,caption);
		return true;
	}

	@Override
	public void visitEnd(Caption caption) {
		pop();
	}

	@Override
	public boolean visitBegin(Container container) {
		push(Container.ELEMENT,container);
		return true;
	}

	@Override
	public void visitEnd(Container container) {
		pop();
	}

	@Override
	public boolean visitBegin(SubHeading subHeading) {
		push(SubHeading.ELEMENT,subHeading);
		return true;
	}

	@Override
	public void visitEnd(SubHeading subHeading) {
		pop();
	}

	@Override
	public boolean visitBegin(QuotedStructure quotedStructure) {
		push(QuotedStructure.ELEMENT,quotedStructure);
		return true;
	}

	@Override
	public void visitEnd(QuotedStructure quotedStructure) {
		pop();
	}

	@Override
	public boolean visitBegin(Content content) {
		push(Content.ELEMENT,content);
		return true;
	}

	@Override
	public void visitEnd(Content content) {
		pop();
	}

	@Override
	public boolean visitBegin(CollectionBody collectionBody) {
		push(CollectionBody.ELEMENT,collectionBody);
		return true;
	}

	@Override
	public void visitEnd(CollectionBody collectionBody) {
		pop();
	}

	@Override
	public boolean visitBegin(Num num) {
		push(Num.ELEMENT,num);
		return true;
	}

	@Override
	public void visitEnd(Num num) {
		pop();
	}

	@Override
	public boolean visitBegin(TocItem tocItem) {
		push(TocItem.ELEMENT,tocItem);
		return true;
	}

	@Override
	public void visitEnd(TocItem tocItem) {
		pop();
	}

	@Override
	public boolean visitBegin(Li li) {
		push(Li.ELEMENT,li);
		return true;
	}

	@Override
	public void visitEnd(Li li) {
		pop();
	}

	@Override
	public boolean visitBegin(Citation citation) {
		push(Citation.ELEMENT,citation);
		return true;
	}

	@Override
	public void visitEnd(Citation citation) {
		pop();
	}

	@Override
	public boolean visitBegin(AuthorialNote authorialNote) {
		push(AuthorialNote.ELEMENT,authorialNote);
		return true;
	}

	@Override
	public void visitEnd(AuthorialNote authorialNote) {
		pop();
	}

	@Override
	public boolean visitBegin(Popup popup) {
		push(Popup.ELEMENT,popup);
		return true;
	}

	@Override
	public void visitEnd(Popup popup) {
		pop();
	}

}